<?php
session_start ();
require_once ("../commun/ouvre_base.php");
// ~ $link = mysqli_connect($host, $userbase, $passwd) or die('Impossible de se connecter pour récupérer niveau : ' . mysql_error());
mysql_select_db ( $db ) or die ( 'Impossible de s&#233;lectionner la base de donn&#233;es' );
// ~ mysqli_select_db($link,$db) or die('Impossible de s&#233;lectionner la base de donn&#233;es');

$_SESSION ['pathway'] = '..';
$_SESSION ['pathway_js'] = '/genetiquespataxeurospa';
include_once ("../header.php");

if (! isset ( $_SESSION ['id'] )) {
	echo "<table class='principale'><tr><td>Session expired</td></tr>";
	echo "<a href='" . $_SESSION ['pathway'] . "/index.php'>Start</a></table>";
} elseif ($_SESSION ['acces_genetique'] == 0) {
	echo "<table class='principale'><tr><td>Restricted area</td></tr>";
	echo "<a href='" . $_SESSION ['pathway'] . "/start.php'>Home</a></table>";
	

	

	
	
	
	
} else {
	
	echo "<script type='text/javascript' src='../js/jquery.min.js'></script>";
	echo "<script type='text/javascript' src='../js/jquery.autocomplete.min.js'></script>";
	

	$action = $_GET ['action']; // edit ou insert
	if ($action == 'edit') {
		echo "<img src='" . $_SESSION ['pathway'] . "/images/modifier.png' height='20' alt='modifier.png' /> ";
	} else if ($action == 'insert') {
		echo "<img src='" . $_SESSION ['pathway'] . "/images/add-icon.png' height='20' alt='button_add.png' /> ";
	}
	echo ucfirst ( $action ) . " screening</p>";
	$table = $_GET ['table']; // edit ou insert
	
	$hash_champ_valeur = array ();
	if ($action == 'edit') { // on récupère les données dans la index déjà dans la base
		
		$index = $_GET ['index'];
		
		// ~ ------------------------ en cas de modifs sur les fichiers
		$query_fichiersattaches = "SELECT `fichiersattaches`
		FROM `screening`
		WHERE `index` LIKE " . $_GET ['index'];
		// ~ echo $query_fichiersattaches;
		$resultat_fichiersattaches = mysql_query ( $query_fichiersattaches ) or die ( "impossible de remplir le questionnaire : " . mysql_error () );
		// ~ $resultat_fichiersattaches = mysqli_query($link,$query_fichiersattaches) or die("impossible de remplir le questionnaire : " . mysql_error());
		$fichiers_attaches_base = mysql_fetch_array ( $resultat_fichiersattaches );
		// ~ $fichiers_attaches_base = mysqli_fetch_array($resultat_fichiersattaches);
		
		$fichiersattaches = $fichiers_attaches_base ['fichiersattaches'];
		if (isset ( $_GET ['delete'] )) {
			$fichiersattaches = str_replace ( $_GET ['delete'] . ';', '', $fichiersattaches );
			unlink ( "../uploads/" . $_GET ['delete'] );
			$query_update_fichiers = "UPDATE `spatax`.`screening` SET `fichiersattaches` = '$fichiersattaches' WHERE `screening`.`index` = " . $_GET ['index'];
			mysql_query ( $query_update_fichiers ) or die ( "impossible d'updater fichiers : " . mysql_error () );
		}
		
		$requete_index = "SELECT * FROM `" . $table . "`
		WHERE `index` LIKE " . $_GET ['index'] . ";";
		// ~ echo $requete_index;
		$result_requete_index = mysql_query ( $requete_index ) or die ( "Impossible de recupérer les entetes : " . mysql_error () );
		// ~ $result_requete_index = mysqli_query($link,$requete_index) or die("Impossible de recupérer les entetes : " . mysql_error());
		
		while ( $ligne = mysql_fetch_assoc ( $result_requete_index ) ) {
			// ~ while($ligne = mysqli_fetch_assoc($result_requete_index)) {
			foreach ( $ligne as $champ => $valeur ) {
				$hash_champ_valeur [$champ] = $valeur;
			}
		}
		$code1 = $hash_champ_valeur ['code1'];
		$code2 = $hash_champ_valeur ['code2'];
		$code3 = $hash_champ_valeur ['code3'];
		$code4 = $hash_champ_valeur ['code4'];
		$code5 = $hash_champ_valeur ['code5'];
		$gene = $hash_champ_valeur ['gene'];
		$alias = $hash_champ_valeur ['alias'];
		$status = $hash_champ_valeur ['statut'];
		$validation = $hash_champ_valeur ['validation'];
		
		// ~ print_r($hash_champ_valeur);
	} elseif ($action == 'insert') {
		require_once ("../requetes/recupere_max.php");
		
		if (isset ( $_SESSION ['code1'] )) {
			$code1 = $_SESSION ['code1'];
		}
		if (isset ( $_SESSION ['code2'] )) {
			$code2 = $_SESSION ['code2'];
		}
		if (isset ( $_SESSION ['code3'] )) {
			$code3 = $_SESSION ['code3'];
		}
		if (isset ( $_SESSION ['code4'] )) {
			$code4 = $_SESSION ['code4'];
		}
		if (isset ( $_SESSION ['code5'] )) {
			$code5 = $_SESSION ['code5'];
		}
		$status = $_SESSION ['status'];
		$validation = $_SESSION ['validation'];
	} else {
		echo "error";
	}
	
	if (isset ( $_FILES ['fichieraajouter'] ) and $_FILES ['fichieraajouter'] ['error'] == 0) {
		$tabledate = getdate ();
		$id_unique = $tabledate ['seconds'] . $tabledate ['minutes'] . $tabledate ['hours'] . $tabledate ['mday'] . $tabledate ['mon'] . $tabledate ['year'];
		
		move_uploaded_file ( $_FILES ['fichieraajouter'] ['tmp_name'], '../../uploads/' . $id_unique . '_' . basename ( $_FILES ['fichieraajouter'] ['name'] ) );
		chmod ( '../../uploads/' . $id_unique . '_' . basename ( $_FILES ['fichieraajouter'] ['name'] ), 0777 );
		$hash_champ_valeur ['fichiersattaches'] .= $id_unique . '_' . basename ( $_FILES ['fichieraajouter'] ['name'] ) . ";";
	}
	
	//print_r($hash_champ_valeur);
	
	?>

<!-- screening ----------------------------->

<?php
	
	$disabled_tous = '';
	if ($_SESSION ['acces_genetique'] >= 2) {
		echo "<form action=\"./requetes/remplissage_screening.php?action=$action&amp;index=$index&amp;table=screening\" method='post' enctype='multipart/form-data'>";
	} else {
		$disabled_tous = 'disabled';
	}
	$disabled_droits_supremes = '';
	if ($_SESSION ['acces_genetique'] < 3) {
		$disabled_droits_supremes = 'disabled';
	}
	?>

<table class='principale'>
	<tr>
		<td><i>User : </i><input <?php echo $disabled_tous.' ';?> type="text"
			name="user" readonly="readonly" style="width: 200px; border: none;"
			value="<?php
	if (isset ( $hash_champ_valeur ['user'] ) and $hash_champ_valeur ['user'] != '') { // on considère que le champ est egal à '' uniquement lors de la création de la fiche qu'il n'est jamais vide après
		echo strtoupper ( $hash_champ_valeur ['user'] );
	} else {
		$hash_champ_valeur ['user'] = $_SESSION ['id'];
		echo strtoupper ( $hash_champ_valeur ['user'] );
	}
	?>" /></td>
		<td><i>Last modifier : </i><input <?php echo $disabled_tous;?>
			type="text" name="last_modifier" readonly="readonly"
			style="width: 200px; border: none;"
			value="<?php
	if (isset ( $hash_champ_valeur ['last_modifier'] ) and $hash_champ_valeur ['last_modifier'] != '') {
		echo strtoupper ( $hash_champ_valeur ['last_modifier'] );
	} else {
		echo strtoupper ( $hash_champ_valeur ['user'] );
	}
	?>" /></td>


		<td><img style='align: right'
			src='<?php echo $_SESSION['pathway']; ?>/images/cadenas.png'
			height='15' alt='This entry is only viewable by you'
			title='This entry is only viewable by you' /></td>
	</tr>
</table>



<table class='principale'>
	<tr>
		<td>Code ID Family : <br /> <input <?php echo $disabled_tous.' ';?>
			type="text" maxlength="3" size="3" name="code1" id="code1"
			value='<?php if(isset($code1)){echo $code1;} ?>' />- <input
			<?php echo $disabled_tous.' ';?> type="text" maxlength="3" size="3"
			name="code2" id="code2"
			value='<?php if(isset($code2)){echo $code2;} ?>' />- <input
			<?php echo $disabled_tous.' ';?> type="text" maxlength="3" size="3"
			name="code3" id="code3"
			value='<?php if(isset($code3)){echo $code3;} ?>' />- <input
			<?php echo $disabled_tous.' ';?> type="text" maxlength="4" size="4"
			name="code4" id="code4"
			value='<?php if(isset($code4)){echo $code4;} ?>' />
		</td>

		<td>Individual&#40;s&#41; : <br /> <input
			<?php echo $disabled_tous.' ';?> type='text' style='width: 100px;'
			name='code5' id="code5"
			value='<?php if(isset($code5)){echo $code5;} ?>' />&#42;&#40;&#34;&#59;&#34;
			as separator&#41;
		</td>
		<td align='center'>and/or :</td>
		<td>External code : <br /> <input <?php echo $disabled_tous.' ';?>
			type='text' style='width: 100px;' name='codeexterne'
			value='<?php if(isset($hash_champ_valeur['codeexterne'])){echo $hash_champ_valeur['codeexterne'];} ?>' />&#42;
		</td>
		<td>Genethon code : <br /> <input <?php echo $disabled_tous.' ';?>
			type='text' style='width: 100px;' name='codegenethon'
			value='<?php if(isset($hash_champ_valeur['codegenethon'])){echo $hash_champ_valeur['codegenethon'];} ?>' /></td>
	</tr>
	<tr>
		<td>Center : <br /> <input <?php echo $disabled_tous.' ';?>
			type='text' style='width: 100px;' name='centre'
			value='<?php if(isset($hash_champ_valeur['centre'])){echo $hash_champ_valeur['centre'];} ?>' /></td>
		<td>Neurologist/Biologist : <br /> <input
			<?php echo $disabled_tous.' ';?> type='text' style='width: 100px;'
			name='neurologist'
			value='<?php if(isset($hash_champ_valeur['neurologist'])){echo $hash_champ_valeur['neurologist'];} ?>' /></td>
	</tr>
</table>

<table class='principale'>
	<tr>
		<td>Date</td>
		<td colspan="2"><input <?php echo $disabled_tous.' ';?> type='text'
			style='width: 100px;' name='date'
			value='<?php if(isset($hash_champ_valeur['date']) and $hash_champ_valeur['date'] != ''){ echo $hash_champ_valeur['date']; }else{ echo $_SESSION['date'];} ?>' />&#42;(yyyy-mm-dd)</td>


		<td style="border: 1px solid #BCD0D6; padding: 10px; align:right;"><p style="float:right;">Status : <select
			<?php echo $disabled_tous.' ';?> size='1' name='statut'>
				<option></option>
				<option value='ongoing'
					<?php if(isset($hash_champ_valeur['statut']) and $hash_champ_valeur['statut'] == 'ongoing'){ echo "selected='selected'"; } ?>>
					ongoing</option>
				<option value='done'
					<?php if(isset($hash_champ_valeur['statut']) and $hash_champ_valeur['statut'] == 'done'){ echo "selected='selected'"; } ?>>
					done</option>
				<option value='to do'
					<?php if(isset($hash_champ_valeur['statut']) and $hash_champ_valeur['m'] == 'to do'){ echo "selected='selected'"; } ?>>
					to do</option>
		</select></p></td>
	</tr>
	<?php
	if ($_SESSION ['acces_genetique'] >= 3) {
		echo "<tr><td>User</td><td><input $disabled_tous type='text' style='width:100px' name='user' value='";
		if (isset ( $hash_champ_valeur ['user'] ) and $hash_champ_valeur ['user'] != '') {
			echo strtoupper ( $hash_champ_valeur ['user'] );
		} else {
			echo strtoupper ( $_SESSION ['id'] );
		}
		echo "' /></td></tr>";
	}
	?>	<tr>
		<td>Gene (ex: ATXN7)</td>
		<td><input <?php echo $disabled_tous.' ';?> type='text'
			style='width: 100px;' name='gene'
			value='<?php if(isset($hash_champ_valeur['gene'])){echo $hash_champ_valeur['gene'];} ?>' /></td>
	</tr>
	<tr>
		<td>Alias (ex: SCA7)</td>
		<td><input <?php echo $disabled_tous.' ';?> type='text'
			style='width: 100px;' name='alias'
			value='<?php if(isset($hash_champ_valeur['alias'])){echo $hash_champ_valeur['alias'];} ?>' /></td>
	</tr>
	
	<tr>
		<td>Mode</td>
		<td colspan="2">
		<label><input <?php echo $disabled_tous.' ';?> type='radio' id='1' name='modescreening' value='dominant' <?php if(isset($hash_champ_valeur['modescreening']) and $hash_champ_valeur['modescreening'] == 'dominant'){ echo "checked='checked'"; } ?> />dominant</label><br /> 
		<label><input <?php echo $disabled_tous.' ';?> type='radio' id='2'	name='modescreening' value='recessive' <?php if(isset($hash_champ_valeur['modescreening']) and $hash_champ_valeur['modescreening'] == 'recessive'){ echo "checked='checked'"; } ?> />recessive</label><br /> 
		<label><input<?php echo $disabled_tous.' ';?> type='radio' id='3'	name='modescreening' value='X-linked' <?php if(isset($hash_champ_valeur['modescreening']) and $hash_champ_valeur['modescreening'] == 'X-linked'){ echo "checked='checked'"; } ?> />X-linked</label><br /> 
		<label><input<?php echo $disabled_tous.' ';?> type='radio' id='4'	name='modescreening' value='pseudodominant' <?php if(isset($hash_champ_valeur['modescreening']) and $hash_champ_valeur['modescreening'] == 'pseudodominant'){ echo "checked='checked'"; } ?> />pseudo-dominant</label><br /> 
		<label><input	<?php echo $disabled_tous.' ';?> type='radio' id='5'	name='modescreening' value='sporadique' <?php if(isset($hash_champ_valeur['modescreening']) and $hash_champ_valeur['modescreening'] == 'sporadique'){ echo "checked='checked'"; } ?> />sporadic</label>
		</td>
	</tr>
	
	<tr>
		<td>Zygosity</td>
		<td colspan="2">
		<br />
		<label><input <?php echo $disabled_tous.' ';?> type='radio'	name='zygosity' value='heterozygous' onclick="toggleDisplayMutation2(this.value)"<?php if(isset($hash_champ_valeur['zygosity']) and $hash_champ_valeur['zygosity'] == 'heterozygous'){ echo " checked='checked'"; } ?> />heterozygous</label><br /> 
		<label><input <?php echo $disabled_tous.' ';?> type='radio' name='zygosity'	value='homozygous' onclick="toggleDisplayMutation2(this.value)"<?php if(isset($hash_champ_valeur['zygosity']) and $hash_champ_valeur['zygosity'] == 'homozygous'){ echo " checked='checked'"; } ?> />homozygous</label><br /> 
		<label><input <?php echo $disabled_tous.' ';?> type='radio' name='zygosity'	value='compound' onclick="toggleDisplayMutation2(this.value)"<?php if(isset($hash_champ_valeur['zygosity']) and $hash_champ_valeur['zygosity'] == 'compound'){ echo " checked='checked'"; } ?> />compound</label><br /> 
		<label><input <?php echo $disabled_tous.' ';?> type='radio' name='zygosity'	value='hemizygous' onclick="toggleDisplayMutation2(this.value)"<?php if(isset($hash_champ_valeur['zygosity']) and $hash_champ_valeur['zygosity'] == 'hemizygous'){ echo " checked='checked'"; } ?> />hemizygous</label><br /> 
		
		</td>
	</tr>

	<tr>
		<td>Technique</td>
		<td colspan="2"><select size='1' name='techniquescreening'>
				<option></option>
				<option value='sequencing' onclick="setReadOnly(this.value, get_radio_value())"	<?php if(isset($hash_champ_valeur['techniquescreening']) and $hash_champ_valeur['techniquescreening'] == 'sequencing'){ echo "selected='selected'"; } ?>>sequencing</option>
				<option value='DHPLC' onclick="setReadOnly(this.value, get_radio_value())" <?php if(isset($hash_champ_valeur['techniquescreening']) and $hash_champ_valeur['techniquescreening'] == 'DHPLC'){ echo "selected='selected'"; } ?>>DHPLC</option>
				<option value='HRM'	onclick="setReadOnly(this.value, get_radio_value())" <?php if(isset($hash_champ_valeur['techniquescreening']) and $hash_champ_valeur['techniquescreening'] == 'HRM'){ echo "selected='selected'"; } ?>>HRM</option>
				<option value='high density microarray'	onclick="setReadOnly(this.value, get_radio_value())"<?php if(isset($hash_champ_valeur['techniquescreening']) and $hash_champ_valeur['techniquescreening'] == 'high density microarray'){ echo "selected='selected'"; } ?>>high density microarray</option>
				<option value='MLPA' onclick="setReadOnly(this.value, get_radio_value())" <?php if(isset($hash_champ_valeur['techniquescreening']) and $hash_champ_valeur['techniquescreening'] == 'MLPA'){ echo "selected='selected'"; } ?>>MLPA</option>
				<option value='TaqMan' onclick="setReadOnly(this.value, get_radio_value())"<?php if(isset($hash_champ_valeur['techniquescreening']) and $hash_champ_valeur['techniquescreening'] == 'TaqMan'){ echo "selected='selected'"; } ?>>TaqMan</option>
				<option value='genotyping' onclick="setReadOnly(this.value, get_radio_value())"<?php if(isset($hash_champ_valeur['techniquescreening']) and $hash_champ_valeur['techniquescreening'] == 'genotyping'){ echo "selected='selected'"; } ?>>genotyping</option>
				<option value='QMPSF' onclick="setReadOnly(this.value, get_radio_value())" <?php if(isset($hash_champ_valeur['techniquescreening']) and $hash_champ_valeur['techniquescreening'] == 'QMPSF'){ echo "selected='selected'"; } ?>>QMPSF</option>
				<option></option>
				<option value='kit_ROCHE_34genes' onclick="setReadOnly(this.value, get_radio_value())" <?php if(isset($hash_champ_valeur['techniquescreening']) and $hash_champ_valeur['techniquescreening'] == 'kit_ROCHE_34genes'){ echo "selected='selected'"; } ?>>Kit ROCHE 34genes</option>
				<option value='kit_ROCHE_74genes' onclick="setReadOnly(this.value, get_radio_value())" <?php if(isset($hash_champ_valeur['techniquescreening']) and $hash_champ_valeur['techniquescreening'] == 'kit_ROCHE_74genes'){ echo "selected='selected'"; } ?>>Kit ROCHE 74genes</option>
				
		
		
		</select></td>
		
	</tr>
	<tr>
		<td></td>
		<td colspan="2">Operator <input <?php echo $disabled_tous.' ';?> type='text'
			style='width: 100px;' name='operator'
			value='<?php if(isset($hash_champ_valeur['operator'])){echo $hash_champ_valeur['operator'];} ?>' /></td>
	</tr>
	<tr>
		<td></td>
		<td colspan="2">Manip nr <input <?php echo $disabled_tous.' ';?> type='text'
			style='width: 100px;' name='manip_nr'
			value='<?php if(isset($hash_champ_valeur['manip_nr'])){echo $hash_champ_valeur['manip_nr'];} ?>' /></td>
	</tr>
	<tr>
		<td></td>
		<td colspan="2">Manip date <input <?php echo $disabled_tous.' ';?> type='text'
			style='width: 100px;' name='manip_date'
			value='<?php if(isset($hash_champ_valeur['manip_date'])){echo $hash_champ_valeur['manip_date'];} ?>' /></td>
	</tr>
	<tr>
		<td></td>
		<td colspan="2">Platform <input <?php echo $disabled_tous.' ';?> type='text'
			style='width: 100px;' name='platform'
			value='<?php if(isset($hash_champ_valeur['platform'])){echo $hash_champ_valeur['platform'];} ?>' /></td>
	</tr>
	<tr>
		<td></td>
		<td>
			<div id='divcommentairessequencage' style='display: none'>
				<textarea name='commentairessequencage' cols='20' rows='1'><?php if(isset($hash_champ_valeur['commentairessequencage'])){echo $hash_champ_valeur['commentairessequencage'];} ?></textarea>
			</div>
			<div id='divcommentairespuceshautedensite' style='display: none'>
				<textarea name='commentairespuceshautedensite' cols='20' rows='1'></textarea>
			</div>
		</td>
	</tr>
	
	<tr><td colspan="4">
		<table class="mutation">
		<tr>
		<td><b>Mutation</b></td>	
		</tr>
		<tr>
		<td>Mutation 1</td>
		<td style="display: table-cell;vertical-align:top;">Coding position<a href="#" onClick="alert('ex:\nENST00000558439:c.[487T>C];ENST00000323669:c.[1758T>A];\nc.123A>G\nc.546delT\nc.546dupT\nc.546_547insT\nc.546_2031inv');return false;"><img height='20' alt="tip" src="../images/point_dinterrogation.png"></a><br />
 			<textarea <?php echo $disabled_tous.' ';?> style='width:200px;' name='coding_position' id='coding_position'><?php if(isset($hash_champ_valeur['coding_position'])){echo $hash_champ_valeur['coding_position'];} ?></textarea>
 		</td>
 		<script>
		$(document).ready(function() {
			$('#coding_position').autocomplete({
				serviceUrl: '../requetes/autocomplete.php',
				dataType: 'json',
				minLength: 2
			});
		});
		</script>
 		<td><p>Entrez le nom d'un pays : <input type="text" id="pays" /></p></td>
 		<script>
	$(document).ready(function() {
		$('#pays').autocomplete({
			serviceUrl: '../requetes/autocomplete.php',
			dataType: 'json',
			minLength: 2
		});
	});
	</script>

		<td>Genomic position <a href="#" onClick="alert('ex: g.123A>G');return false;"><img height='20' alt="tip" src="../images/point_dinterrogation.png"></a><br />
			<input type=text <?php echo $disabled_tous.' ';?> style='width: 150px;' name='genomic_position' value='<?php if(isset($hash_champ_valeur['genomic_position'])){echo $hash_champ_valeur['genomic_position'];} ?>' />
			<br />&nbsp;
			<br />&nbsp;
			<br />&nbsp;
 		</td> 
 		
 		<td>Protein position<a href="#" onClick="alert('ex:\np.P252R\np.F508del\np.G4_Q6dup\np.K2_L3insQS\np.R83SfsX15');return false;"><img height='20' alt="tip" src="../images/point_dinterrogation.png"></a><br />
 			<input type=text <?php echo $disabled_tous.' ';?> style='width: 150px;' name='protein_position' value='<?php if(isset($hash_champ_valeur['protein_position'])){echo $hash_champ_valeur['protein_position'];} ?>' />
 			<br />&nbsp;
 			<br />&nbsp;
 			<br />&nbsp;
 		</td>
  		<td>Splicing position<a href="#" onClick="alert('ex: r.546delT');return false;"><img height='20' alt="tip" src="../images/point_dinterrogation.png"></a><br />
 			<input type=text <?php echo $disabled_tous.' ';?> style='width: 150px;' name='splicing_position' value='<?php if(isset($hash_champ_valeur['splicing_position'])){echo $hash_champ_valeur['splicing_position'];} ?>' />
 			<br />&nbsp;
 			<br />&nbsp;
 			<br />&nbsp;
 		</td>
 		</tr>

		<tr>
		<td><div id='mutation2' style='display:none;'>Mutation 2</div></td>
		<td style="display: table-cell;vertical-align:top;"><div id='mutation3' style='display:none;'>
 			<textarea <?php echo $disabled_tous.' ';?> style='width:200px;' name='coding_position2'><?php if(isset($hash_champ_valeur['coding_position2'])){echo $hash_champ_valeur['coding_position2'];} ?></textarea></div>
 		</td>
		<td><div id='mutation4' style='display:none;'>
			<input type=text <?php echo $disabled_tous.' ';?> style='width: 150px;' name='genomic_position2' value='<?php if(isset($hash_champ_valeur['genomic_position2'])){echo $hash_champ_valeur['genomic_position2'];} ?>' />
			<br />&nbsp;
			<br />&nbsp;
			<br />&nbsp;
 		</div></td> 
 		
 		<td><div id='mutation5' style='display:none;'>
 			<input type=text <?php echo $disabled_tous.' ';?> style='width: 150px;' name='protein_position2' value='<?php if(isset($hash_champ_valeur['protein_position2'])){echo $hash_champ_valeur['protein_position2'];} ?>' />
 			<br />&nbsp;
 			<br />&nbsp;
 			<br />&nbsp;
 		</div></td>
  		<td><div id='mutation6' style='display:none;'>
  			<input type=text <?php echo $disabled_tous.' ';?> style='width: 150px;' name='splicing_position2' value='<?php if(isset($hash_champ_valeur['splicing_position2'])){echo $hash_champ_valeur['splicing_position2'];} ?>' />
 			<br />&nbsp;
 			<br />&nbsp;
 			<br />&nbsp;
 		</div></td>
 		</tr>

	 	<tr>
	 		<td></td>
	 		<td colspan="2"><input <?php echo $disabled_tous.' ';?> type='checkbox'	name='verifvalidationscreening' id='verifvalidationscreening' <?php if(isset($hash_champ_valeur['verifvalidationscreening']) and preg_match("/yes/", $hash_champ_valeur['verifvalidationscreening'])){ echo "checked='checked'"; } ?> value='yes' /> Checked in a second sample or other method : <input <?php echo $disabled_tous.' ';?> type='text'	name='commentaireverification' id='commentaireverification'	style='width: 150px;' value='<?php if(isset($hash_champ_valeur['commentaireverification'])){echo $hash_champ_valeur['commentaireverification'];} ?>' />
			</td>
		</tr>
	
	 	</table>
	</td></tr>

	<tr>
		<td>Cosegregation</td>
		<td>
		<label><input <?php echo $disabled_tous.' ';?> type='radio' style='width: 100px;' name='cosegregation' value='yes' <?php if(isset($hash_champ_valeur['cosegregation']) and $hash_champ_valeur['cosegregation'] == 'yes'){ echo "checked='checked'"; } ?> />yes </label><br />
		<label><input <?php echo $disabled_tous.' ';?> type='radio' style='width: 100px;' name='cosegregation' value='no' <?php if(isset($hash_champ_valeur['cosegregation']) and $hash_champ_valeur['cosegregation'] == 'no'){ echo "checked='checked'"; } ?> />no </label>
		</td>
	</tr>

	<tr>
		<td>Polymorphisms</td>
		<td><textarea <?php echo $disabled_tous.' ';?> name='polymorphismes'
				cols='20' rows='10'><?php if(isset($hash_champ_valeur['polymorphismes'])){echo $hash_champ_valeur['polymorphismes'];} ?></textarea></td>
		<td>Comments<br />
		<textarea <?php echo $disabled_tous.' ';?> name='commentairepolymorphismes' cols='20' rows='1'><?php if(isset($hash_champ_valeur['commentairepolymorphismes'])){echo $hash_champ_valeur['commentairepolymorphismes'];} ?></textarea>
		</td>
	</tr>

	<tr>
		<td>Comments</td>
		<td><textarea <?php echo $disabled_tous.' ';?>
				name='commentairesscreening' cols='20' rows='5'><?php if(isset($hash_champ_valeur['commentairesscreening'])){echo $hash_champ_valeur['commentairesscreening'];} ?></textarea></td>
	</tr>

	<tr>
		<td>Attached file(s)</td>
		<td>
		<?php	
		if (isset ( $hash_champ_valeur ['fichiersattaches'] )) {
			$table_fichiers = explode ( ';', $hash_champ_valeur ['fichiersattaches'] );
			foreach ( $table_fichiers as $fichier_attache ) {
				if ($fichier_attache != '') {
					echo "<img src='" . $_SESSION ['pathway'] . "/images/poubelle.png' height='15' onclick=\"confirmer_suppression_fichier('" . $code1 . '-' . $code2 . '-' . $code3 . '-' . $code4 . '-' . $code5 . "','$index','$table','$fichier_attache')\" /> <a target=_blank href='../uploads/$fichier_attache'>$fichier_attache</a><br />"; // on affiche juste la liste des fichiers déjà présents dans la base
				}
			}
		}?>
		</td>
		<td><input <?php echo $disabled_tous.' ';?> type='hidden' id='fichiersattaches' name='fichiersattaches'	value='<?php if(isset($hash_champ_valeur['fichiersattaches'])){ echo $hash_champ_valeur['fichiersattaches']; } ?>' /></td>
		<td><input <?php echo $disabled_tous.' ';?> type='file' name='fichieraajouter' size="10" value='' /><input <?php echo $disabled_tous.' ';?> type='submit' name='submitprinc' value='upload' /><i> (max 10)</i></td>
	</tr>
</table>

<table class='principale'>
	<tr>
		<td><h3>Diagnosis :</h3></td>
		<td><label><input <?php echo $disabled_tous.' ';?> type='radio'
				name='diagnosticscreening' value='mutated'
				<?php if(isset($hash_champ_valeur['diagnosticscreening']) and $hash_champ_valeur['diagnosticscreening'] == 'mutated'){ echo "checked='checked'"; } ?> />
				mutated </label><br /> <label><input
				<?php echo $disabled_tous.' ';?> type='radio'
				name='diagnosticscreening' value='not mutated'
				<?php if(isset($hash_champ_valeur['diagnosticscreening']) and $hash_champ_valeur['diagnosticscreening'] == 'not mutated'){ echo "checked='checked'"; } ?> />
				not mutated </label><br /> <label><input
				<?php echo $disabled_tous.' ';?> type='radio'
				name='diagnosticscreening' value='healthy carrier'
				<?php if(isset($hash_champ_valeur['diagnosticscreening']) and $hash_champ_valeur['diagnosticscreening'] == 'healthy carrier'){ echo "checked='checked'"; } ?> />
				healthy carrier </label><br /> <label><input
				<?php echo $disabled_tous.' ';?> type='radio'
				name='diagnosticscreening' value='inconclusive'
				<?php if(isset($hash_champ_valeur['diagnosticscreening']) and $hash_champ_valeur['diagnosticscreening'] == 'inconclusive'){ echo "checked='checked'"; } ?> />
				inconclusive </label></td>
	</tr>

	<tr>
		<td><h3>Validation :</h3></td>

		<td>

	<?php
	echo "<label><input " . $disabled_tous . ' ' . $disabled_droits_supremes . ' ' . "type='radio' name='validation' value='yes' ";
	if (isset ( $validation ) and $validation == 'yes') {
		echo "checked='checked'";
	}
	echo "/> yes </label><br />";
	echo "<label><input " . $disabled_tous . ' ' . $disabled_droits_supremes . ' ' . "type='radio' name='validation' value='no' ";
	if (isset ( $validation ) and $validation == 'no' or isset ( $validation ) and $validation == '') {
		echo "checked='checked'";
	}
	echo "/> no </label>";
	?>

	</td>
	</tr>
	<tr>
		<td><h3>To do :</h3></td>
		<td><textarea <?php echo $disabled_tous.' ';?> name='afaire' cols='15'
				rows='3'><?php if(isset($hash_champ_valeur['afaire'])){echo $hash_champ_valeur['afaire'];} ?></textarea></td>
	</tr>

	<tr>
		<td><h3>Comments</h3></td>
		<td><textarea <?php echo $disabled_tous.' ';?>
				name='commentairesconclusion' cols='15' rows='3'><?php if(isset($hash_champ_valeur['commentairesconclusion'])){echo $hash_champ_valeur['commentairesconclusion'];} ?></textarea></td>
	</tr>
	<tr>
		<td><input <?php echo $disabled_tous.' ';?> type='submit'
			name='submitprinc' value='Ok' /></td>
	</tr>
</table>
</form>

<?php
}
include ("../footer.php");
?>
